package com.supinfo.food.services;

public class MagasinServiceProxy implements com.supinfo.food.services.MagasinService {
  private String _endpoint = null;
  private com.supinfo.food.services.MagasinService magasinService = null;
  
  public MagasinServiceProxy() {
    _initMagasinServiceProxy();
  }
  
  public MagasinServiceProxy(String endpoint) {
    _endpoint = endpoint;
    _initMagasinServiceProxy();
  }
  
  private void _initMagasinServiceProxy() {
    try {
      magasinService = (new com.supinfo.food.services.MagasinServiceServiceLocator()).getMagasinService();
      if (magasinService != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)magasinService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)magasinService)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (magasinService != null)
      ((javax.xml.rpc.Stub)magasinService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public com.supinfo.food.services.MagasinService getMagasinService() {
    if (magasinService == null)
      _initMagasinServiceProxy();
    return magasinService;
  }
  
  public com.supinfo.food.entities.Magasin[] getAll() throws java.rmi.RemoteException{
    if (magasinService == null)
      _initMagasinServiceProxy();
    return magasinService.getAll();
  }
  
  public java.lang.String[] getCountries() throws java.rmi.RemoteException{
    if (magasinService == null)
      _initMagasinServiceProxy();
    return magasinService.getCountries();
  }
  
  public void add(com.supinfo.food.entities.Magasin magasin) throws java.rmi.RemoteException{
    if (magasinService == null)
      _initMagasinServiceProxy();
    magasinService.add(magasin);
  }
  
  public void delete(long id) throws java.rmi.RemoteException{
    if (magasinService == null)
      _initMagasinServiceProxy();
    magasinService.delete(id);
  }
  
  
}